Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
No hay rutas que coincidan con la ubicación "/guión/1"

Tengo el siguiente problema. mi ruta no está registrada y no sé por qué.

Enlaces

tablero.jsx

este código genera todos los enlaces.

 <div className="flex w-3/4 m-auto flex-col mt-10 xl:w-1/2"> {questions.map(({ id, question }) => { return ( <Link to={`/dash/${id}`}> <QuestionHeader question={question} /> </Link> ); })} </div>
 /dash/1,/dash/2,.... are generated by the map function above.

tengo dos archivos que representan las rutas.

Rutas de navegación

 const NavRoutes = () => { return ( <Routes> <Route path="/:id" element={<Question />} /> <Route path="" element={<Dashboard />} /> </Routes> ); }; export default NavRoutes;

aquí está el componente principal

 const Main = () => { return ( <div> <NavBar /> <NavRoutes /> <Footer /> </div> ); }; export default Main;

y las principales vías de autenticación y acceso a la página principal

 const App = () => { let { user } = useAuthContext(); return ( <div className="w-full bg-slate-700 block fixed h-full"> <Header /> <Router> <Routes> <Route path="/dash" element={!user ? <Navigate to="/auth" /> : <Main />} > </Route> <Route path="" element={<Login />} /> </Routes> </Router> </div> ); };

cuando trato de acceder a /dash/1 , aparece el siguiente error

 router.ts:11 No routes matched location "/dash/1"
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

¿Intentó lo siguiente en sus NavRoutes (anteponiendo '/ dash' a '/: id'):

 <Route path="/dash/:id" element={<Question />} />
about 4 years ago · Juan Pablo Isaza Report

0

Resolví esto haciendo lo siguiente

 const App = () => { let { user } = useAuthContext(); return ( <div className="w-full bg-slate-700 block fixed h-full"> <Header /> <Router> <Routes> <Route path="/dash/*" element={!user ? <Navigate to="/auth" /> : <Main />} > </Route> <Route path="/auth" element={<Login />} /> </Routes> </Router> </div> ); };

debe incluir un * al anidar más profundo

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!